package cn.m1c.cntt.wuhan2020.cnttlifegoods.weixin.service

import org.apache.http.client.methods.HttpGet
import org.apache.http.impl.client.HttpClientBuilder
import org.apache.http.util.EntityUtils
import org.apache.logging.log4j.kotlin.Logging
import org.springframework.core.env.Environment
import org.springframework.data.redis.core.RedisTemplate
import org.springframework.stereotype.Service
import javax.annotation.Resource


@Service
class WeixinService : Logging {

    @Resource
    lateinit var redisTemplate: RedisTemplate<String, String>
    @Resource
    lateinit var env: Environment

    fun ticket(): String {
        val url = "http://"
        val client = HttpClientBuilder.create().build()
        val get = HttpGet(url)
        val res = client.execute(get!!)
        val entity = res.entity
        var responseContent = EntityUtils.toString(entity, "UTF-8")
        return responseContent
    }
}